/**   
 * Copyright © 2018 金风科技. All rights reserved.
 * 
 * @Title: ResponseEntity.java 
 * @Prject: tgcw-c-common
 * @Package: com.goldwind.common.po 
 * @Description: 通用返回实体
 * @author: liangwenlu   
 * @date: 2019年3月25日 下午3:29:13
 * @version: V1.0   
 */
package com.gd.iot.energy.entity;


import com.gd.iot.energy.code.ResponseCode;
import com.gd.iot.energy.consts.SystemConsts;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;


/**
 * @ClassName: ResponseEntity
 * @Description: 通用返回实体
 */
public class ResponseEntity<T> implements Serializable{
	
	/**
	 * @fieldName: code
	 * @fieldType: String
	 * @Description: 返回码
	 */
	@ApiModelProperty(value = "返回码", hidden = false)
	private String code;

	/**
	 * @fieldName: msg
	 * @fieldType: String
	 * @Description: 返回码说明
	 */
	@ApiModelProperty(value = "返回码说明", hidden = false)
	private String msg;

	/**
	 * @fieldName: data
	 * @fieldType: T
	 * @Description: 返回数据
	 */
	@ApiModelProperty(value = "返回数据", hidden = false)
	private T data;

	/**
	 * @fieldName: time
	 * @fieldType: Date
	 * @Description: 系统时间
	 */
	@ApiModelProperty(value = "系统时间", hidden = false)
	private Date time = new Date();

	public ResponseEntity(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public ResponseEntity() {
		this.code = ResponseCode.SUCCESS;
		this.msg = SystemConsts.SUCCESS_MSG;
		this.data = data;
	}

	public ResponseEntity(T data) {
		this.code = ResponseCode.SUCCESS;
		this.msg = SystemConsts.SUCCESS_MSG;
		this.data = data;
	}

	public ResponseEntity(String code, String msg, T data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
}
